package likou.tanxin;

/**
 * @author: Tangxz
 * @email: 1171702529@qq.com
 * @cate: 2020/11/15 09:52
 */
public class _944 {
    public static void main(String[] args) {
        System.out.println(minDeletionSize(new String[]{"rrjk","furt","guzm"}));
    }
    public static int minDeletionSize(String[] A) {
        if(A.length<=1||A[0].length()==1){
            return 0;
        }
        byte[][] bytes = new byte[A.length][A[0].length()];
        for(int i=0;i<A.length;i++){
            bytes[i] = A[i].getBytes();
        }
        int daan = 0;
        for(int i=0;i<A[0].length();i++){
            for(int j=1;j<A.length;j++){
                if(bytes[j-1][i]<=bytes[j][i]){
                    continue;
                }else{
                    daan++;
                    break;
                }
            }
        }
        return daan;
    }
}
